<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>编辑部门</title>
  <link rel="stylesheet" th:href="@{/layui-v2.6.8/css/layui.css}" href="/static/layui-v2.6.8/css/layui.css">
</head>
<body>
<div style="padding: 15px;">
  <div>
    <a th:href="@{/dep/getDepList}">
      <i class="layui-icon layui-icon-return" style="font-size: 30px; color: #1E9FFF;"></i>
    </a>
  </div>
  <form class="layui-form form-position" action="/amin/dep/editDep" method="post">
    <input type="text" name="id" th:field="${dep.id}" style="display: none;">
    <div class="layui-form-item">
      <label class="layui-form-label">部门名称</label>
      <div class="layui-input-block">
        <input type="text" name="depName" th:field="${dep.depName}" required  lay-verify="required" placeholder="请输入部门名称" autocomplete="off" class="layui-input layui-input-width">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">上级部门</label>
      <div class="layui-input-block">
        <select name="parentId" lay-filter="aihao" th:field="${dep.parentId}" >
          <option th:each="depList:${depList}" th:value="${depList.id}" th:text="${depList.depName}"></option>
        </select>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">部门编码</label>
      <div class="layui-input-block" >
        <input type="text" name="depCode" th:field="${dep.depCode}" required  lay-verify="required" placeholder="请输入部门编码" autocomplete="off" class="layui-input layui-input-width">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">部门序号</label>
      <div class="layui-input-block">
        <input type="text" name="sort" th:field="${dep.sort}" required  lay-verify="required" placeholder="请输入部门序号" autocomplete="off" class="layui-input layui-input-width">
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" lay-submit lay-filter="formDemo">保存</button>
        <!--
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        -->
      </div>
    </div>

  </form>
</div>
</body>
<!-- 引入 layui.js -->
<script th:src="@{/layui-v2.6.8/layui.js}" src="/static/layui-v2.6.8/layui.js"></script>
<script>
  layui.use(function(){
    var layer = layui.layer
            ,form = layui.form;
    layer.msg('Hello World');
    //监听提交
    form.on('submit(formDemo)', function(data){
      //layer.msg(JSON.stringify(data.field));
      return true;
    });
  });
</script>
</html>